load("//tools/build_defs:javac.bzl", "JAVACOPTS_OSS")

licenses(["notice"])

package(default_visibility = ["//:__subpackages__"])

java_library(
    name = "hkdf_prf_key_manager",
    srcs = ["HkdfPrfKeyManager.java"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        ":prf_set",
        "//proto:common_java_proto",
        "//proto:hkdf_prf_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:core",
        "//src/main/java/com/google/crypto/tink/subtle",
        "//src/main/java/com/google/crypto/tink/subtle/prf:hkdf_streaming_prf",
        "//src/main/java/com/google/crypto/tink/subtle/prf:prf_impl",
        "//src/main/java/com/google/crypto/tink/subtle/prf:streaming_prf",
        "@com_google_protobuf_javalite//:protobuf_javalite",
    ],
)

java_library(
    name = "prf_key_templates",
    srcs = ["PrfKeyTemplates.java"],
    javacopts = JAVACOPTS_OSS,
    visibility = ["//visibility:public"],
    deps = [
        ":hkdf_prf_key_manager",
        "//proto:common_java_proto",
        "//proto:hkdf_prf_java_proto",
        "//proto:tink_java_proto",
    ],
)

java_library(
    name = "prf_config",
    srcs = ["PrfConfig.java"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        ":hkdf_prf_key_manager",
    ],
)

java_library(
    name = "prf_set",
    srcs = [
        "Prf.java",
        "PrfSet.java",
    ],
    javacopts = JAVACOPTS_OSS,
    visibility = ["//visibility:public"],
    deps = [
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:core",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "hkdf_prf_key_manager-android",
    srcs = ["HkdfPrfKeyManager.java"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        ":prf_set",
        "//proto:common_java_proto_lite",
        "//proto:hkdf_prf_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:core-android",
        "//src/main/java/com/google/crypto/tink/subtle",
        "//src/main/java/com/google/crypto/tink/subtle/prf:hkdf_streaming_prf",
        "//src/main/java/com/google/crypto/tink/subtle/prf:prf_impl",
        "//src/main/java/com/google/crypto/tink/subtle/prf:streaming_prf",
        "@com_google_protobuf_javalite//:protobuf_javalite",
    ],
)

java_library(
    name = "prf_key_templates-android",
    srcs = ["PrfKeyTemplates.java"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        ":hkdf_prf_key_manager-android",
        "//proto:common_java_proto_lite",
        "//proto:hkdf_prf_java_proto_lite",
        "//proto:tink_java_proto_lite",
    ],
)

java_library(
    name = "prf_config-android",
    srcs = ["PrfConfig.java"],
    javacopts = JAVACOPTS_OSS,
    deps = [
        ":hkdf_prf_key_manager-android",
    ],
)
